﻿using NicoView.ViewModel.Message;
using NicoView.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace NicoView.View
{
    /// <summary>
    /// NicoUserInfoWindow.xaml の相互作用ロジック
    /// </summary>
    public partial class NicoViewUserInfoWindow : Window
    {
        public NicoViewUserInfoWindow()
        {
            InitializeComponent();
            this.UserInfoControl.UserInfoLinkClick += onUserInfoLinkClick;
        }

        private void onUserInfoLinkClick(object arg1, RoutedEventArgs arg2)
        {
            this.Close();
        }




        public static void Show(NicoViewShowUserInfoCommentsMessage e, MainWindow baseWindow)
        {
            var window = new NicoViewUserInfoWindow();
            window.UserInfoControl.DataContext = new NicoViewUserInfoViewModel(e.User, e.Comments);
            window.Owner = baseWindow;
            window.Show();
        }

        private void UserInfoWindow_Closed(object sender, EventArgs e)
        {


            this.UserInfoControl.UserInfoLinkClick -= onUserInfoLinkClick;
            this.UserInfoControl.Dispose();
           
        }

    }
}
